package com.lzctzk.serviceaddress;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * Title:
 * Description:
 * Company:
 *
 * @user GuiYue
 * @time 11:15
 * @project_name service-address
 * @package_name com.lzctzk.serviceaddress
 **/

@Configuration
public class Swagger2Config
{
    @Bean
    public Docket createRestApi()
    {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.lzctzk.serviceaddress.controller"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo()
    {
        return new ApiInfoBuilder()
                .title("位置信息服务接口文档")
                .description("描述:用于提供位置信息相关服务的接口")
                .contact(new Contact("蒲贵川","10FangClever",null))
                .version("1.0")
                .build();
    }
}
